﻿Imports DTO
Public Class DAAlarm
    Inherits DataProvider
    Shared Sub ConfigServerName(ByVal serverName As String)
        ' call constructor base class
        ConfigServer(serverName)
    End Sub
    '/******************************************************************/
    '/*                         Insert Alarm                           */
    '/******************************************************************/
    Shared Function InsertAlarm(ByVal dtoAlarm As DTOAlarm) As Integer
        Return Update("insertAlarm", {"@alarmNo", "@machineNo", "@alarmTime", "@createDateTime", "@updateDateTime"}, {dtoAlarm.AlarmNoProperty, dtoAlarm.MachineNoProperty, dtoAlarm.AlarmTimeProperty, dtoAlarm.CreateDateTimeProperty, dtoAlarm.UpdateDateTimeProperty})
    End Function
    '/******************************************************************/
    '/*                    Delete Alarm with Machine No                */
    '/******************************************************************/
    Shared Function DeleteAlarm(ByVal machineNo As Integer) As Integer
        Return Update("deleteAlarm", {"@machineNo"}, {machineNo})
    End Function
    '/******************************************************************/
    '/*                       Get Alarm with Machine No                */
    '/******************************************************************/
    Shared Function GetAlarm(ByVal machineNo As Integer) As DataTable
        Return Query("getAlarm", {"machineNo"}, {machineNo})
    End Function
End Class
